package com.day1019.snake;

import java.util.Random;
//   食物类
public class Food extends Node {
    public Food() {
        this.reset();
    }

    //  随机出现食物
    public void reset(){
        Random random = new Random();
        int x = random.nextInt(41);
        int y = random.nextInt(42);
        super.setX(x);
        super.setY(y);
    }
}
